home *** CD-ROM | disk | FTP | other *** search
- Path: rain.fr!news
- From: Fabien Bergeret <fbergeret@nahua.arcanet.fr>
- Newsgroups: comp.lang.c
- Subject: Re: ** Disabling ctrl-C in C **
- Date: Tue, 12 Mar 96 16:25:10 WET
- Organization: CSI InterNetNews site
- Message-ID: <NEWTNews.826648066.7747.fbergeret@nahua.arcanet.fr>
- References: <4hpbv3$6u@maltese.eag.unisysgsg.com> <fcusack-0803960930130001@mudskipper.cac.psu.edu>
- NNTP-Posting-Host: nahua.arcanet.fr
- Mime-Version: 1.0
- Content-Type: TEXT/PLAIN; charset=US-ASCII
- X-Newsreader: NEWTNews & Chameleon -- TCP/IP for MS Windows from NetManage
-
-
- > > Was wondering if there was a way in C to dis-allow users to break
- > > out of a program when at a prompt.....Tryed to use getche(), getch() and
- > > that won't work 'cause I don't have access to conio.h -- By the way, I am
- > > on a UNIX machine. Everything that I have already thought of
- > > pertains to dos.
- >
- > You probably wanted to post this on comp.unix.programmer then.
- >
- > see man signal
- It's quite easy on a Unix machine. Each process receives a signal ( don't
- remember which one ) when Ctrl-C it hit. All you've got to do is write a
- signal handler for this signal, and to activate it ( with a
- signal(signal_name, signal_handler ) at the beginning of your code.
- Hope this helps
-
- Fabien Bergeret
-
-